package com.twittex
{
    import com.twittex.controller.*;
    import com.twittex.model.*;
    import com.twittex.view.*;
    import com.twittex.view.components.ApplicationScreen;
    
    import org.puremvc.as3.interfaces.*;
    import org.puremvc.as3.patterns.facade.*;
    import org.puremvc.as3.patterns.proxy.*;

    public class TwittexFacade extends Facade
    {
        public static const STARTUP:String 					= "startup";
        public static const SHUTDOWN:String 				= "shutdown";

        public static const LOGIN_SUCCEED:String			= "loginSucceed";
        public static const LOGIN_FAILED:String				= "loginFailed";

		public static const VIEW_LOGIN_SCREEN:String		= "viewLoginScreen";
		public static const VIEW_MAIN_SCREEN:String			= "viewMainScreen";
		public static const VIEW_FRIENDS_SCREEN:String      = "viewFriendsScreen";
		public static const VIEW_REPLIES_SCREEN:String      = "viewRepliesScreen";

		public static const FIND_USER:String                = "findUser";
		public static const USER_FOUND:String               = "userFound";
		public static const FIND_FRIEND_STATUSES:String     = "findFriendStatuses";
		public static const FRIEND_STATUSES_FOUND:String    = "friendStatusesFound";
		public static const UPDATE_STATUS:String            = "postStatus";
		public static const STATUS_UPDATED:String           = "statusPosted";
		public static const FIND_REPLIES_STATUSES:String    = "findRepliesStatuses";
		public static const REPLIES_STATUSES_FOUND:String   = "repliesStatusesFound";
		
		public static const IMAGE_UPLOADED:String           = "imageUploaded";
		public static const IMAGE_FAILED:String             = "imageFailed";

        public static function getInstance() : TwittexFacade 
		{
            if ( instance == null ) instance = new TwittexFacade( );
            return instance as TwittexFacade;
        }

        override protected function initializeController( ) : void 
        {
            super.initializeController(); 
            registerCommand( STARTUP, StartupCommand );
            registerCommand( FIND_USER, ShowUserCommand );
        }

		public function startup( app:ApplicationScreen ):void
		{
			sendNotification( STARTUP, app );
		}
		
    }
}